/**
 * \file _des.hpp
 * \brief Internal headerfile for DES
 * \author Wouter Caarls <w.caarls@tudelft.nl> 
 *
 * \verbatim
 * Copyright (c) 2005-7 Wouter Caarls, Delft University of Technology
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * \endverbatim
 */

#ifndef ___DES_HPP
#define ___DES_HPP

#include <signal.h>

#include "des.hpp"
#include "heap.hpp"
#include "lxt_write.h"

class DESeventManager
{
public:
  DESeventManager() : m_queue(65536), m_time(0), m_trace(NULL), m_events(0) { }

  TIME run();
  void addEvent(DESevent event);

public:
  CHeap<DESevent> m_queue;
  DESprocess *m_process;
  TIME m_time;  
  ucontext_t m_context;
  struct lt_trace *m_trace;
  int m_events;
  int m_abort;
  sighandler_t m_intsig;
};

extern DESeventManager g_eventManager;

#endif /* ___DES_HPP */
